<template>
    <div style="margin: 0 30px 0 0">
        <fault-data :faults="faults" page-type="5" :total="total"/>
    </div>
</template>

<script>
import FaultData from '../../components/repair/fault-data'
import { fetchFaults } from '../../utils/repairData'
const  module = require('../../utils/repairData')

export default {
  name: 'SearchTask',
  components: {
    'fault-data': FaultData
  },
  data() {
    return {
      //  向 fault-data 中传递的数据
      //  那个页面调用的 fault-dat
      faults: [],
      total: 0,
      // 查询条件
      queryParams: {
        pageType: -1,
        page: 1,
        size: 10
      }
    }
  },
  mounted() {
    this.initFaults()
  },
  methods: {
    initFaults() {
      const response = fetchFaults(this.queryParams.pageType, this.queryParams.page, this.queryParams.size)
      this.faults = response.data.faults
      this.total = response.data.total
    }
  }
}
</script>

<style>

</style>
